@extends('admin.layouts.app')
@section('content')
<div class="page-header">
        <h3 class="page-title">
           <a href="{{route('admin.case.create')}}" class="btn btn-success btn-xs">添加案例</a>
        </h3>
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="{{ route('admin.case.index') }}">案例管理</a></li>
                <li class="breadcrumb-item active" aria-current="page">案例列表</li>
            </ol>
        </nav>
    </div>
<div class="row">
   <div class="col-md-12 grid-margin stretch-card">
<div class="card">
                <div class="card-body">
                <form action="{{route('admin.case.delh')}}" method="post">
                            @csrf
                            <input type="submit" value="批量删除" class="btn btn-danger btn-lg">
                  <table class="table">
                    <thead>
                      <tr>
                      <th width="10%">
                                    <div class="form-check form-check-danger">
                                        <label class="form-check-label">
                                            <input class="form-check-input" type="checkbox" id="ischecked">
                                        </label>
                                    </div>
                                </th>
                        <th class="text-center" width="5%">ID</th>
                        <th class="text-center">案例名称</th>
                        <th class="text-center" width="20%">发布时间</th>
                        <th class="text-center" width="10%">操作</th>
                      </tr>
                    </thead>
                    <tbody>
                    @foreach($case as $vo)
                      <tr>
                      <td class="text-center">
                                    <div class="form-check form-check-danger">
                                        <label class="form-check-label">
                                            <input class="form-check-input mychecked" name="ids[]" value="{{ $vo->id }}" type="checkbox">
                                        </label>
                                    </div>
                                </td>
                        <td class="text-center">{{$vo->id}}</td>
                        <td class="text-center" >{{$vo->title}}</td>
                        <td class="text-center">{{$vo->created_at}}</td>
                        <td class="text-center">
                        <a href="{{route('admin.case.edit',$vo->id)}}" class="btn btn-success btn-sm" style="float:left;margin-right:10px;">编辑</a>
                        </form>
                        {!! Form::open(['route'=>['admin.case.destroy',$vo->id],'method'=>'DELETE']) !!}

                        <button type="submit" class="btn btn-danger btn-sm" style="float:left;">
                            删除
                        </button>
                         {!! Form::close() !!}


                        </td>
                      </tr>
                    @endforeach
                    </tbody>
                  </table>

                  <div style="padding:10px 0;">
                   {{$case->links()}}
                    </div>
                </div>
              </div>
</div>
</div>
@endsection

